package com.interesting.client.UI.setting;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;

import com.interesting.R;
import com.interesting.base.core.BaseActivity;

/** 设置主界面 activity */
public class MoreActivity extends BaseActivity {

	Fragment content;

	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.setting_set_activity);
		
		getSupportActionBar().setCustomView(R.layout.text_actionbar_custom_view);
		setTitle(getResources().getString(R.string.more));
		content = new MoreFragment();

		FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
		ft.replace(R.id.set_activity_frame, content, "main");
		ft.commit();
	}

	/** 相应fragment的点击事件 */
	public void switchfragment(String tag) {
		Fragment fragment = getSupportFragmentManager().findFragmentByTag(tag);
		if (fragment == null) {
			if (tag.equals("opinion")) {
				fragment = new OpinionFragment();
			}
			if (tag.equals("about")) {
				fragment = new AboutFragment();
			}
		}
		FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
		ft.replace(R.id.set_activity_frame, fragment, tag);
		ft.commit();
	}
}
